#include <Arduino.h>
#include "Protothread.h"
#include "main.h"


int serial_putc( char c, struct __file * )
{
    Serial.write( c );
    return c;
}


void setup() {
    Serial.begin(115200);
    pinMode(LED1_PIN, OUTPUT);  // sets the digital pin 13 as output
    pinMode(KEY1_PIN, INPUT);    // sets the digital pin 7 as input
    fdevopen( &serial_putc, 0 );
    printf("***arduino.cn***\n\r");
}

/**
   The main game loop
*/
void loop() {
    static uint32_t ms=0;
    if(millis()-ms>=10){
        Protothread::OnTickAll();
        ms=millis();
    }
}

